package com.cn.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.cn.dto.Dog;
import com.cn.dto.User;
import com.cn.mapper.UserMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.solon.annotation.Db;
import org.noear.solon.annotation.Controller;
import org.noear.solon.annotation.Inject;
import org.noear.solon.annotation.Mapping;
import org.noear.solon.core.AppContext;

import java.util.List;

@Controller
@Api("DemoController")
public class DemoController {
    @Inject
    Dog dog;

    @Db
    UserMapper userMapper;
    @Inject
    AppContext appContext;



    @Mapping("h")
    @ApiOperation("hello")
    public String hello(String name) {
        String name1 = name;
        System.out.println(name1.length() > 5);
        return "asdasd";
    }

    @Mapping("b")
    public List<User> b() {
        return userMapper.selectList(new LambdaQueryWrapper<>());
    }

    @Mapping("c")
    @ApiOperation("redis")
    public String msg() {
        return "tmp";
    }
}